#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdio.h>
int main()
{
    int arr[100][100] = { 0 };
    int x = 0;
    int y = 0;
    int ret = 0;
    scanf("%d %d", &x, &y);
    int i = 0;
    int j = 0;
    for (i = 0; i < x; i++)
    {
        for (j = 0; j < y; j++)
        {
            scanf("%d", &arr[i][j]);
        }
    }
    for (i = 0; i < x; i++)
    {
        for (j = 0; j < y; j++)
        {
            if (arr[i][j] > 0)
            {
                ret += arr[i][j];
            }
        }
    }
    printf("%d", ret);
    return 0;
}